package linkwechat.controller.system;

import linkwechat.pojo.CustomersSeas;
import linkwechat.pojo.ReturnData;
import linkwechat.pojo.SysUseres;
import linkwechat.service.systemservice.PerSonalService;
import linkwechat.util.OssTempate;
import org.apache.poi.ss.usermodel.DataFormatter;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@Controller
@RequestMapping("/personnal")
public class PerSonalController {

    @Resource
    OssTempate ossTempate;

    @Autowired
    PerSonalService perSonalService;


    //上传头像
    @RequestMapping("/Tx")
    @ResponseBody
    public ReturnData UpdTx(MultipartFile file,Long id){
        String upload = ossTempate.upload(file);
        System.out.println(upload);
        return  perSonalService.UpdTx(upload,id);
    }

    //保存基本资料
    @RequestMapping("/UpdGeRzl")
    @ResponseBody
    public ReturnData UpdGeRzl(SysUseres sysUseres){
        return perSonalService.UpdFeRzl(sysUseres);
    }

    //修改密码
    @RequestMapping("/UpdPwd")
    @ResponseBody
    public ReturnData UpdPwd(String password,Long id){
        return perSonalService.UpdPwd(password,id);
    }


}
